limsResult.ckeditorDetialPage = {

    getBaseFormParam: function () {
        let _this = this
        return {
            type: 'form',
            service: 'limsResultServiceImpl',
            dbTable: 'T_LIMS_RESULT',
            id: 'result-ckeditor-form',
            // columns: 1,
            readonly: _this.param.readonly === 'true',
            fields: [{
                // field : 'originalResult',
                field: 'finalResult',
                titleAlign: 'left',
                type : 'ckeditor',
                colspan: 3,
                height: 700,
            }],
        }
    },


    create: function () {
        let _this = this;
        Gikam.create('layout', {
            renderTo: Gikam.getLastModal().window.$dom,
            center: {
                items: [this.getBaseFormParam()]
            },
        });
    },

    init: function (param) {
        this.param = param;
        this.create();
        if(Gikam.isNotEmpty(param.analyteId) && Gikam.isNotEmpty(param.orderTaskId)) {
            Gikam.getAsyncComp('result-ckeditor-form').done(function(form) {
                form.refresh({
                    url : Gikam.printf(limsResult.baseUrl + '/task/{taskId}/analyte/{analyteId}', {
                        taskId : param.orderTaskId,
                        analyteId : param.analyteId
                    })
                });
            });
        }
    }
};
